#!/usr/bin/env pythonBasics
# -*-coding:utf-8-*-

#Author:super
import os

def filePath(fileDir,fileName):
	'''
	返回文件目录地址
	:param fileDir: 文件路径
	:param fileName: 文件名称
	:return:
	'''
	return os.path.join(os.path.dirname(os.path.dirname(__file__)),fileDir,fileName)

def readContent(fileDir,fileName):
	'''
	读取文件
	:param fileDir: 文件目录
	:param fileName: 文件名称
	:return:
	'''
	with open(filePath(fileDir,fileName),'r',encoding = 'utf-8') as f:
		return f.read()
	
def writeContent(fileDir,fileName,s):
	'''
	写入文件
	:param fileDir: 文件目录
	:param fileName: 文件名称
	:param s: 写入的字符串
	:return:
	'''
	with open(filePath(fileDir,fileName),'w',encoding = 'utf-8') as f:
		f.write(s)

if __name__ == '__main__':
    print(readContent('data','gettoken.ini'))